Efficient garbage collection in a compressed journal file

ABSTRACT

A map corresponding to data blocks with overwritten compressed journal entries is configured. Weighted conditions for each of the overwritten compressed journal entries are calculated. The weighted conditions are arranged in the map from lowest to highest. One of the weighted conditions includes a biasing variable towards selecting data blocks having free space at an end of at least one associated record.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a Continuation of U.S. patent application Ser. No.13,275,178, filed on Oct. 17, 2011.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates generally to computers, and moreparticularly, to efficient garbage collection in a compressed journalfile in a computing environment.

2. Description of the Related Art

In today's society, computer systems are commonplace. Computer systemsmay be found in the workplace, at home, or at school. Computer systemsmay include data storage systems, or disk storage systems, to processand store data. The data can be lost due to problems such as systemcrashes, hardware failures, and abnormal computing system halts.Journaled file systems can be used to maintain data integrity when thesetypes of problems occur. Journaled file systems maintain file systemintegrity by recording information regarding updates to directories,bitmaps, and/or data, in a log, also called a journal, before theupdates are written to a storage device such as a hard disk. In theevent of a system crash or other problem. the information in the journalcan be used to restore the file system to a consistent state.Full-journaling file systems additionally perform data journaling, inwhich data updates are also stored in the journal, to ensure that nocommitted data is lost.

SUMMARY OF THE DESCRIBED EMBODIMENTS

In a data processing system or computing environment, a journaling filesystem may be used to store the write operations in a journal. In acompressed journal file system the journal holds compressed data. Whenan overwrite operation is performed, the overwrite operation of the datainvalidates an old record and creates a hole in the journal. As aresult, efficiency and productivity may be reduced.

Accordingly, and in view of the foregoing, various exemplary method,system, and computer program product embodiments for efficient garbagecollection in a compressed journal file system are provided. In oneembodiment, by way of example only, a map corresponding to data blockswith overwritten compressed journal entries is configured. Weightedconditions for each of the overwritten compressed journal entries arecalculated. The weighted conditions are arranged in the map from lowestto highest weight. One of the weighted conditions includes a biasingvariable towards selecting data blocks having free space at an end of atleast one associated record.

In addition to the foregoing exemplary method embodiment, otherexemplary embodiments are provided and supply related advantages. Theforegoing summary has been provided to introduce a selection of conceptsin a simplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used as an aid in determining the scope of the claimed subjectmatter. The claimed subject matter is not limited to implementationsthat solve any or all disadvantages noted in the background.

BRIEF DESCRIPTION OF THE DRAWINGS

In order that the advantages of the invention will be readilyunderstood, a more particular description of the invention brieflydescribed above will be rendered by reference to specific embodimentsthat are illustrated in the appended drawings. Understanding that thesedrawings depict embodiments of the invention and are not therefore to beconsidered to be limiting of its scope, the invention will be describedand explained with additional specificity and detail through the use ofthe accompanying drawings, in which:

FIG. 1 illustrates a computing environment having an example storagedevice in which aspects of the present invention may be realized;

FIG. 2 illustrates an exemplary block diagram showing a hardwarestructure of a data storage system in a computer system in which aspectsof the present invention may be realized;

FIG. 3 illustrates an exemplary block diagram showing a compressedjournal file system;

FIG. 4 illustrates an exemplary block diagram showing garbage collectionin a compressed journal file;

FIG. 5 is a flowchart illustrating an exemplary method for performinggarbage collection in a compressed journal file; and

FIG. 6 is a flowchart illustrating an exemplary method for calculatingweighted conditions with a biasing variable for selecting data blockshaving free space at an end of a record.

DETAILED DESCRIPTION OF CERTAIN EMBODIMENTS

In a data processing system or computing environment, a journaling filesystem may be used to store the write operations in a journal. In acompressed journal file system the journal holds compressed data. Theability to access the data randomly is accomplished by dividing thejournal into blocks that use a separate dictionary. When an overwriteoperation is performed, the overwrite operation of the data invalidatesan old record and creates a hole in the journal. As a result, efficiencyand productivity may he reduced.

In order to increase the efficiency and productivity, by closing theholes created by an overwrite operation on the records in the compressedjournal file entries, the mechanisms of the illustrated embodimentsapply a garbage collection process to close these holes by moving thedata into new locations in the journal.

In one embodiment, selecting the best journal block for garbagecollection is critical and the mechanisms perform the garbage collectionon free blocks at the end of the file, allowing for the file to betruncated. Moreover, the mechanisms of the illustrated embodimentsperform the garbage collection on blocks with minimal valid data,minimal valid record counts, and on blocks based upon the age of theblocks. In the current state of the art, only one of these conditionscan be met with the existing algorithms.

In an alternative embodiment, the mechanisms create a new operation(e.g., create a new algorithm) for selecting the best block for garbagecollection based upon the following; the free blocks at the end of afile, minimal valid data, minimal valid record count, the number ofrecords in read cache, and the age of the blocks. The algorithm of thepresent invention is considerate of all the different conditionsrequired for the selection. The selection may be performed by assigninga weighted value to each of the different conditions, as illustratedabove, and enables real-time selection of garbage collection block,based on a data structure management. The new algorithm meets all theconditions described herein, and thus, enables truncating the file whilemaintaining efficiency while selecting the blocks with minimal data.Such processing allows for freeing more used space, reducing the numberof IO required for the garbage collection, and completes the time basedcompression algorithm.

Turning to FIG. 1, an example computer system 10 is depicted in whichaspects of the present invention may be realized. Computer system 10includes central processing unit (CPU) 12, which is connected to massstorage device(s) 14 and memory device 16. Mass storage devices mayinclude hard disk drive (HDD) devices, which may be configured in aredundant array of independent disks (RAID). The garbage collectionoperations further described may be executed on device(s) 14, located insystem 10 or elsewhere. Memory device 16 may include such memory aselectrically erasable programmable read only memory (EEPROM) or a hostof related devices. Memory device 16 and mass storage device 14 areconnected to CPU 12 via a signal-bearing medium. In addition, CPU 12 isconnected through communication port 18 to a communication network 20,having an attached plurality of additional computer systems 22 and 24.The computer system 10 may include one or more processor devices (e.g.,CPU 12) and additional memory devices 16 for each individual componentof the computer system 10 to execute and perform each operationdescribed herein to accomplish the purposes of the present invention.

FIG. 2 is an exemplary block diagram 200 showing a hardware structure ofa data storage system in a computer system according to the presentinvention. Host computers 210, 220, 225, are shown, each acting as acentral processing unit for performing data processing as part of a datastorage system 200. The hosts (physical or virtual devices), 210, 220,and 225 may be one or more new physical devices or logical devices toaccomplish the purposes of the present invention in the data storagesystem 200. In one embodiment, by way of example only, a data storagesystem 200 may be implemented as IBM® System Storage™ DS8000™. A Networkconnection 260 may be a fibre channel fabric, a fibre channel point topoint link, a fibre channel over ethernet fabric or point to point link,a FICON or ESCON I/O interface, any other I/O interface type, a wirelessnetwork, a wired network, a LAN, a WAN, heterogeneous, homogeneous,public (i.e. the Internet), private, or any combination thereof. Thehosts, 210, 220, and 225 may be local or distributed among one or morelocations and may be equipped with any type of fabric (or fabricchannel) (not shown in FIG. 2) or network adapter 260 to the storagecontroller 240, such as Fibre channel, FICON, ESCON, Ethernet, fiberoptic, wireless, or coaxial adapters. Data storage system 200 isaccordingly equipped with a suitable fabric (not shown in FIG. 2) ornetwork adapter 260 to communicate. Data storage system 200 is depictedin FIG. 2 comprising storage controller 240 and storage 230.

To facilitate a clearer understanding of the methods described herein,storage controller 240 is shown in FIG. 2 as a single processing unit,including a microprocessor 242, system memory 243 and nonvolatilestorage (“NVS”) 216, which will be described in more detail below. It isnoted that in some embodiments, storage controller 240 is comprised ofmultiple processing units, each with their own processor complex andsystem memory, and interconnected by a dedicated network within datastorage system 200. Storage 230 may be comprised of one or more storagedevices, such as storage arrays, which are connected to storagecontroller 240 by a storage network.

In some embodiments, the devices included in storage 230 may beconnected in a loop architecture. Storage controller 240 manages storage230 and facilitates the processing of write and read requests intendedfor storage 230. The system memory 243 of storage controller 240 storesthe operation software 250, program instructions and data, which theprocessor 242 may access for executing functions and method stepsassociated with managing storage 230, and executing the steps andmethods of the present invention. As shown in FIG. 2, system memory 243may also include or be in communication with a cache 245 for storage230, also referred to herein as a “cache memory”, for buffering “writedata” and “read data”, which respectively refer to write/read requestsand their associated data. In one embodiment, cache 245 is allocated ina device external to system memory 243, yet remains accessible bymicroprocessor 242 and may serve to provide additional security againstdata loss, in addition to carrying out the operations as describedherein.

In some embodiments, cache 245 is implemented with a volatile memory andnon-volatile memory and coupled to microprocessor 242 via a local bus(not shown in FIG. 2) for enhanced performance of data storage system200. The NVS 216 included in data storage controller is accessible bymicroprocessor 242 and serves to provide additional support foroperations and execution of the present invention as described in otherfigures. The NVS 216, may also referred to as a “persistent” cache, or“cache memory” and is implemented with nonvolatile memory that may ormay not utilize external power to retain data stored therein. The NVSmay be stored in and with the cache 245 for any purposes suited toaccomplish the objectives of the present invention. In some embodiments,a backup power source (not shown in FIG. 2), such as a battery, suppliesNVS 216 with sufficient power to retain the data stored therein in caseof power loss to data storage system 200. In certain embodiments, thecapacity of NVS 216 is less than or equal to the total capacity of cache245.

Storage 230 may be physically comprised of one or more storage devices,such as storage arrays. A storage array is a logical grouping ofindividual storage devices, such as a hard disk. In certain embodiments,storage 230 is comprised of a JBOD (Just a Bunch of Disks) array or aRAID (Redundant Array of Independent Disks) array. A collection ofphysical storage arrays may be further combined to form a rank, whichdissociates the physical storage from the logical configuration. Thestorage space in a rank may be allocated into logical volumes, whichdefine the storage location specified in a write/read request.

In one embodiment, the storage system as shown in FIG. 2 may include alogical volume, or simply “volume,” may have different kinds ofallocations. Storage 230 a, 230 b and 230 n are shown as ranks in datastorage system 200, and are referred to herein as rank 230 a, 230 b and230 n. Ranks may be local to data storage system 200, or may be locatedat a physically remote location. In other words, a local storagecontroller may connect with a remote storage controller and managestorage at the remote location. Rank 230 a is shown configured with twoentire volumes, 234 and 236, as well as one partial volume 232 a. Rank230 b is shown with another partial volume 232 b. Thus volume 232 isallocated across ranks 230 a and 230 b. Rank 230 n is shown as beingfully allocated to volume 238—that is, rank 230 n refers to the entirephysical storage for volume 238. From the above examples, it will beappreciated that a rank may be configured to include one or more partialand/or entire volumes. Volumes and ranks may further be divided intoso-called “tracks,” which represent a fixed block of storage. A track istherefore associated with a given volume and may be given a given rank.

The storage controller 240 may include a garbage collection module 255to assist with garbage collection in a compressed journal file system.The garbage collection module 255 may work in conjunction with each andevery component of the storage controller 240, the hosts 210, 220, 225,and storage devices 230. Both the garbage collection module 255 may bestructurally one complete module or may be associated and/or includedwith other individual modules. The garbage collection module 255 mayalso be located in the cache 245 or other components of the storagecontroller 240 to accomplish the purposes of the present invention.

The storage controller 240 includes a control switch 241 for controllingthe fiber channel protocol to the host computers 210, 220, 225, amicroprocessor 242 for controlling all the storage controller 240, anonvolatile control memory 243 for storing a microprogram (operationsoftware) 250 for controlling the operation of storage controller 240,data for control and each table described later, cache 245 fortemporarily storing (buffering) data, and buffers 244 for assisting thecache 245 to read and write data, a control switch 241 for controlling aprotocol to control data transfer to or from the storage devices 230,and garbage collection module 255 in which information may be set.Multiple buffers 244 may be implemented with the present invention toassist with garbage collection in a compressed journal file system asdescribed herein.

In one embodiment, the host computers or one or more physical or virtualdevices, 210, 220, 225 and the storage controller 240 are connectedthrough a network adaptor (this could be a fibre channel) 260 as aninterface i.e., via a switch called “fabric.” In one embodiment, theoperation of the system shown in FIG. 2 will be described. Themicroprocessor 242 may control the memory 243 to store commandinformation from the host device (physical or virtual) 210 andinformation for identifying the host device (physical or virtual) 210.The control switch 241, the buffers 244, the cache 245, the operatingsoftware 250, the microprocessor 242, memory 243, NVS 216, and garbagecollection module 255 are in communication with each other and may beseparate or one individual component(s). Also, several, if not all ofthe components, such as the operation software 245 may be included withthe memory 243 for performing garbage collection in a compressed journalfile system. Each of the components within the devices shown may belinked together and may be in communication with each other for purposessuited to the present invention.

FIG. 3 illustrates an exemplary block diagram showing a compressedjournal file system. In a data processing system, a journaling filesystem may be used to store the write operations in a journal, as shownby W1, W2, W3, and W4. The data is compressed as C1, C2, C3, and C4,which may then be stored in block segments 1, 2, 3, and 4. The abilityto access the data randomly is done by dividing the journal into blocksthat uses a separate dictionary. When an overwrite operation isperformed, the overwrite operation of the data invalidates an old recordand creates a hole in the journal, as illustrated by the compressed datablock's 1 through 6. Block 6 depicts an overwrite operation of datainvalidating an old record and creating a hole in the journal.

As mentioned previously, in order to increase the efficiency andproductivity by closing the holes created by an overwrite operation onthe records in the compressed journal file entries, the mechanisms ofthe illustrated embodiments apply a garbage collection process to closethese holes by moving the data into a new location(s) in the journal.

FIG. 4 illustrates an exemplary block diagram showing garbage collectionin a compressed journal file. In FIG. 4, part 1 depicts a full block ofdata with 5 separate segments. Segments 1, 2, 3, and 4, were originallywritten together into the block, so segments 1, 2, 3, and 4 will be inthe cache. Part 2 illustrates an overwrite operation being performed onsegment 2. Segments 1, 3, and 4 each need to be relocated, which mayeasily be achieved since segment 2 was recently modified and allsegments that make up the block that contains segment 2 will be in thecache. Part 3 illustrates that the initial block is now a free block asa result of the original segments 1, 3, and 4 being relocated (e.g.,grouped) with the input/output (I/O) of the write operation 85. Itshould be noted that only read operations insert data into read-cache.

To enable the selection of the block for garbage collection, aspreviously described, the mechanisms use the following data structures.First, each compression block in the journal file system may include thefollowing metadata structure; the number of records, the size of eachrecord, and the age of the overwritten block. Second, a map isconfigured to hold a list of blocks with overwritten records in thejournal. Any partially filled data block may consist of valid compresseddata logs and invalid (overwritten) data logs. Thus the mechanismsprefer to select data block with a minimal number of valid logs and amaximal size of the freed space. Hence, the key for the map consists ofthe number of valid records, represented by the variable x, the size ofdata in the valid records, represented by the variable y, the blockposition inside the physical file, represented by the variable z, andthe weight of each of the map entries is calculated based on the keyvalue is calculated according to: (x+(y/x))*(z/range), where the rangeis the range of data blocks with the weighted conditions that areequivalent. The range corresponds to the file/volume range. Thefile/volume is divided into ranges, and each range is assigned aweighted value according to the distance from the range is from theorigin. Unlike the standard allocation algorithms, that are used bygarbage collection processes, regardless of the location that thegarbage collection process will free in the data, the mechanism of thepresent invention seek to free data from the end of the blocks. Thedimension Z, as mentioned above, is the relative block position to theend of the file, represented in the formula by Z. The dimension of “Z”is a biasing variable to select the data block with free space at theend of the file. The new algorithm uses garbage collection to free spaceand then the algorithm is used for allocating requested space.

To assist the mechanisms of the illustrated embodiments for effectingefficient garbage collection, the map is limited by size so the blockswith high number of valid records may not be inserted into the map. Thisenables the mechanisms of the present invention to apply more weight toage of the block and/or record and will support time based compressionand its benefits. The age of the block is the time difference betweenthe last overwrite operation and the current time. The age of the datablock may be enforced outside of the weight formula. This isaccomplished with by the weight of the specific data block beingcalculated every time the user overwrites any part of the data relatedto this block. Thus, the block map may consist of ranges of data blockswith the same weight. Any new block may be inserted in the specificweight range at the end of this group. The map enables the mechanisms tofind the next block for garbage collection and eliminates the need tocontinuously calculate the weight of the conditions by the weightedformula because the block weight is calculated during an insertoperation and the blocks are always arranged from low weight to highweight. By limiting the size of the block map, block with lower age(i.e. blocks that was overwritten earlier) are allowed to enter the map.Hence, the block position is important in the weight calculation and forthe selection of the garbage collection process.

The selection of data blocks with free space at the end of a record/fileenables the file to be truncated faster and reclaim the space to thefile system. In a block based system, thin provisioning spacereclamation may be also based on freeing space at the end of the logicalunit. This unique effect on garbage collection weight calculation isdistinctive for compression due to the space freeing that compressionpresents. For the garbage collection weight calculation, the mechanismsmay also consider another condition/value of the data availability.

In one embodiment, the mechanisms perform the garbage collection on datablocks that are present in the read cache, which enables the datamovement without the read input/output (I/O) operation required forfetching the data to be moved. However, the garbage collectionoperations may be performed for a block that is not available in thecache if the total weight, obtained from the weighted conditions,justifies the garbage collection. Ideally, it is preferable to performthe garbage collection on the partial data blocks with the same weightwith data in the read cache, but the mechanisms may chose data blockswith weight above some threshold value for the garbage collection.

FIG. 5 is a flowchart illustrating an exemplary method 500 forperforming garbage collection in a compressed journal file. The method500 begins (step 502) by configuring a map corresponding to data blockswith overwritten compressed journal entries (step 504). Weightedconditions for each of the overwritten compressed journal entries arecalculated (step 506). These weighted conditions may include the numberof valid records, the size of data in the valid records, and the blockposition inside the physical file. The weighted conditions in the mapare arranged from the lowest to highest weight (step 508). The method500 may include as one of the weighted conditions a biasing variabletowards selecting data blocks having free space at an end of oneassociated record (step 510). The method 500 ends (step 512).

FIG. 6 is a flowchart illustrating an exemplary method 600 forcalculating weighted conditions with a biasing variable for selectingdata blocks having free space at an end of a record. The method 600begins (step 602) with performing the calculating for the weightedconditions according to (x−w+(y/x))*(z/range) (step 604). The variable xis the number of valid records, y is the size of data in the validrecords, z (which represents a third or new dimension) is the blockposition inside a file, and w is the number of records in read cache.The method 600 may perform the calculating each time data is overwrittenon the data blocks and each time the data blocks are added to the map(step 606). The method 600 may limit the size of the map by the age ofthe data blocks to exclude the data blocks with the highest number ofvalid records from entering the map (step 608). The method 600 maydetermine if the weighted conditions of the data blocks exceed athreshold value (610). The data blocks for garbage collection, that havea minimal number of valid data, a minimal valid record count(s), and amaximum size of the free space, may be selected (612). The method 600may determine if one of the data blocks is in a read cache (step 614).If yes, the method 600 may perform the selecting for the data blockspresent in the read cache with weighted conditions that are equivalentin value (step 616). If no, the method 600 may determine if one of thedata blocks' weighted conditions exceed a threshold value (step 618). Ifone of the data blocks' weighted conditions does not exceed a thresholdvalue, the method 600 may return to (step 612) and select the datablocks for garbage collection that have a minimal number of valid data,a minimal valid record count(s), and a maximum size of the free space(step 612). If one of the data blocks' weighted conditions does exceed athreshold value, the method 600 may perform the selecting for the datablocks not present in a read cache (step 620). The method 600 ends (step622).

In one embodiment, the mechanisms for performing efficient garbagecollection in a compressed journal configure a map corresponding to datablocks with overwritten compressed journal entries. Weighted conditionsare calculated for each of the overwritten compressed journal entries.The weighted conditions are arranged in the map from lowest to highestorder. One of the weighted conditions may include a biasing variabletowards selecting data blocks having free space at an end of at leastone associated record.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that may contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wired, optical fiber cable, RF, etc., or any suitable combination of theforegoing. Computer program code for carrying out operations for aspectsof the present invention may be written in any combination of one ormore programming languages, including an object oriented programminglanguage such as Java, Smalltalk, C++ or the like and conventionalprocedural programming languages, such as the “C” programming languageor similar programming languages. The program code may execute entirelyon the user's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described above with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, may be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that may direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks. The computer program instructions may also beloaded onto a computer, other programmable data processing apparatus, orother devices to cause a series of operational steps to be performed onthe computer, other programmable apparatus or other devices to produce acomputer implemented process such that the instructions which execute onthe computer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The flowchart and block diagram in the above figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock might occur out of the order noted in the figures. For example,two blocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, may be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

While one or more embodiments of the present invention have beenillustrated in detail, one of ordinary skill in the art will appreciatethat modifications and adaptations to those embodiments may be madewithout departing from the scope of the present invention as set forthin the following claims.

What is claimed is:
 1. A method for efficient garbage collection in acompressed journal file system by a processor device in a computingenvironment, the method comprising: configuring a map corresponding todata blocks with overwritten compressed journal entries; and calculatingweighted conditions for each of the overwritten compressed journalentries, wherein the weighted conditions are arranged in the map fromlowest to highest; wherein one of the weighted conditions includes abiasing variable towards selecting data blocks having free space at anend of at least one associated record.
 2. The method of claim 1, furtherincluding, performing the calculation for the weighted conditionsaccording to: (x−-w+(y/x))*(z/range), where w is a number of records ina read cache, x is a number of valid records, y is a size of data in thevalid records, z is a relative position of the data block to the end ofthe at least one record, and range is the range of data blocks with theweighted conditions that are equivalent.
 3. The method of claim 1,further including, limiting the size of the map by the age of the datablocks to exclude the data blocks with the highest number of validrecords from entering the map, wherein the age of the block is a timedifference between the last overwrite operation on the data block and acurrent time.
 4. The method of claim 1, wherein the calculating isperformed each time data is overwritten on the data blocks and each timethe data blocks are added to the map, wherein the weighted conditions ofthe data blocks are arranged in the map from lowest to highest.
 5. Themethod of claim 1, further including selecting the data blocks forgarbage collection with a minimal number of valid data, minimal validrecord count, and maximum size of the free space.
 6. The method of claim5, further including, in conjunction with the selection, determining ifthe weighted conditions of the data blocks exceed a threshold value. 7.The method of claim 6, further including, performing the selecting forthe data blocks present in a read cache with weighted conditions thatare equivalent.
 8. The method of claim 7, further including, if one ofthe data blocks is not in the read cache, and if the one of the datablocks weighted conditions exceeds the threshold value, performing theselecting for one of the data blocks.